<?php if(!defined('BASEPATH')) exit('No direct script access allowed!');

define('STUDENTS_URL', 'return ' . 
	var_export(array(
		'home' => anchor('student/landings/info', 'Beranda'),
		'info' => anchor('student/landings/info', 'Info Pribadi'),
		'announcement' => anchor('student/announcement', 'Pengumuman'),
		'absence' => anchor('student/absence', 'Absensi'),
		'grade' => anchor('student/grade', 'Nilai'),
		'schedule' => anchor('student/schedule/today', 'Jadwal'),
		'schedule/today' => anchor('student/schedule/today', 'Hari Ini'),
		'schedule/subject' => anchor('student/schedule/subject', 'Pelajaran'),
		'library' => anchor('student/library', 'Perpustakaan'),
		'library/book' => anchor('student/library/book', 'Daftar Buku'),
		'library/rent' => anchor('student/library/rent', 'Peminjaman'),
		'change_password' => anchor('student/landings/change_password', 'Ganti Password'),
	), true) . ';');

function students_url($key) {
	$students_url = eval(STUDENTS_URL);
	return $students_url[$key];
}

function value_limit($limits_map, $subject_id, $value) {
	$limit = $limits_map[$subject_id];
	if ($value < $limit) {
		return '<span class="remedial">'.$value.'</span>';
	}
	return $value;
}
